﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace VlcPlayerRemoteActionPlugin
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class VlcPlayerActionParamsPanel : UserControl
    {
        public VlcPlayerActionParamsPanel()
        {
            InitializeComponent();
        }

        private void execute_Click(object sender, RoutedEventArgs e)
        {
            VlcPlayerActionParameters model = (VlcPlayerActionParameters)this.DataContext;
            new VlcPlayerActionPlugin().Execute(model);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            VlcPlayerActionParameters model = (VlcPlayerActionParameters)this.DataContext;
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName = ""; // Default file name
            dlg.Multiselect = false;
            //dlg.DefaultExt = ".mp3"; // Default file extension
            //dlg.Filter = "Audio Files(*.MP3;*.WMA;*.WAV)|*.MP3;*.WMA;*.WAV|All files (*.*)|*.*"; // Filter files by extension

            // Show open file dialog box
            Nullable<bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                model.Directory= dlg.FileName;
            }
        }

        private void help_Click(object sender, RoutedEventArgs e)
        {
            string messageBoxText = VlcPlayerActionParameters.Help;
            string caption = "Help";
            MessageBoxButton button = MessageBoxButton.OK;
            MessageBoxImage icon = MessageBoxImage.Information;
            MessageBox.Show(messageBoxText, caption, button, icon);
        }
    }
}
